gh-87389: Fix an open redirection vulnerability in http.server. (GH-93879) (GH-94093)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 22 Jun 2022 08:42:02 +0000 (01:42 -0700)
committerArnaud Rebillout <arnaudr@debian.org>
Tue, 14 Apr 2026 04:38:32 +0000 (11:38 +0700)
commitfa3a088bba15ab9dc85a82e0edf97d6b79fa9b83
tree827e5ff5ac42067f50653cc118df37872cc2c716
parent794a739e0cab08fc68227946d180f1a1111a6505
gh-87389: Fix an open redirection vulnerability in http.server. (GH-93879) (GH-94093)

Fix an open redirection vulnerability in the `http.server` module when
an URI path starts with `//` that could produce a 301 Location header
with a misleading target.  Vulnerability discovered, and logic fix
proposed, by Hamza Avvan (@hamzaavvan).

Test and comments authored by Gregory P. Smith [Google].
(cherry picked from commit 4abab6b603dd38bec1168e9a37c40a48ec89508e)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Gbp-Pq: Name 0008-gh-87389-Fix-an-open-redirection-vulnerability-in-ht.patch
Lib/http/server.py
Lib/test/test_httpservers.py